<!DOCTYPE HTML>
<html>
<head>
<title>Mail</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="Gourmet Responsive web template, Bootstrap Web Templates, Flat Web Templates, Andriod Compatible web template, 
Smartphone Compatible web template, free webdesigns for Nokia, Samsung, LG, SonyErricsson, Motorola web design" />
<script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
<!-- bootstrap -->
<link href="css/bootstrap.css" rel='stylesheet' type='text/css' media="all" />
<!-- //bootstrap -->
<!-- Custom Theme files -->
<link href="css/style.css" rel='stylesheet' type='text/css' media="all" />
<script src="js/jquery-1.8.3.min.js"></script>
<script src="js/modernizr.custom.js"></script>
<!--start-smoth-scrolling-->
<!--webfonts-->
	<link href='http://fonts.useso.com/css?family=Open+Sans:400italic,600italic,700italic,400,300,600,700,800' rel='stylesheet' type='text/css'>
	<link href='http://fonts.useso.com/css?family=Niconne' rel='stylesheet' type='text/css'>
<!--webfonts-->	
<link href="css/component.css" rel="stylesheet" type="text/css"  />



	<!-- jQuery (Bootstrap 的所有 JavaScript 插件都依赖 jQuery，所以必须放在前边) -->
	<script src="https://cdn.jsdelivr.net/npm/jquery@1.12.4/dist/jquery.min.js"></script>
	<!-- 加载 Bootstrap 的所有 JavaScript 插件。你也可以根据需要只加载单个插件。 -->
	<script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js"></script>
	<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
	<script src="https://cdn.bootcdn.net/ajax/libs/axios/0.21.1/axios.min.js"></script>
	<script src="http://code.jquery.com/jquery-3.4.1.js"></script>
</head>
<body class="cbp-spmenu-push">
<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-30027142-1', 'w3layouts.com');
  ga('send', 'pageview');
</script>

<!--header-->
	<div class="header-section2">
			<div class="container">
				<div class="header-top">
					<div class="top-nav">
						<nav class="cbp-spmenu cbp-spmenu-vertical cbp-spmenu-left" id="cbp-spmenu-s2">
							<h3>Menu</h3>
							<ul>
								<li><a href="myindex.html">Home</a></li>
								<li class="menu">Menu</li>
									<ul class="cl-effect-1">
										<li><a href="menu.html">Menu1</a></li>                                             
										<li><a href="menu.html">Menu2</a></li>
										<li><a href="menu.html">Menu3</a></li> 
										<li><a href="menu.html">Menu4</a></li>  
									</ul>
									<!-- script-for-menu -->
									 <script>
									   $( "li.menu" ).click(function() {
										 $( "ul.cl-effect-1" ).slideToggle( 300, function() {
										 // Animation complete.
										  });
										 });
									</script>
								<li><a href="events.html">Events</a></li>
								<li><a href="error/404.html">Gallery</a></li>
								<li><a href="mail.html">Mail Us</a></li>
							</ul>
						</nav>
						<div class="main buttonset">	
								<!-- Class "cbp-spmenu-open" gets applied to menu and "cbp-spmenu-push-toleft" or "cbp-spmenu-push-toright" to the body -->
								<button id="showRightPush"><img src="images/menu.png" alt=""/></button>
								<!--<span class="menu"></span>-->
						</div>
						<!-- Classie - class helper functions by @desandro https://github.com/desandro/classie -->
						<script src="js/classie.js"></script>
						<script>
						var menuRight = document.getElementById( 'cbp-spmenu-s2' ),
						showRightPush = document.getElementById( 'showRightPush' ),
						body = document.body;

						showRightPush.onclick = function() {
							classie.toggle( this, 'active' );
							classie.toggle( body, 'cbp-spmenu-push-toleft' );
							classie.toggle( menuRight, 'cbp-spmenu-open' );
							disableOther( 'showRightPush' );
						};

						function disableOther( button ) {
							if( button !== 'showRightPush' ) {
								classie.toggle( showRightPush, 'disabled' );
							}
						}
					 </script>
					</div>
					<div class="header-logo">
						<a href="myindex.html"><img src="images/logo.png" alt="" /></a>
					</div>
					<div class="search-form">
						<form>
							<input type="text" value="Search..." onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Search...';}" required="">
						</form>
					</div>
					<div class="clearfix"> </div>
				</div>
			</div>
	</div>
<!--/header-->
<!--/header-->
			<!--start-contact-->
	<div class="contact-content">
		<div class="container">
			<div class="contact-form">
					<h3>欢迎您提出您的建议</h3>
				<div class="form">
					<form action="" id="myForm">
						<input type="text" v-model="username"  name="userName"  autocomplete="off" disabled ="disabled">
						<input type="text"  v-model="email"  name="email"  autocomplete="off" disabled ="disabled" >
						<input type="text" placeholder="主题" required="required" name="subject" >
						<textarea placeholder="建议内容" required="required" name="content"></textarea>
						<input type="button" value="提交" @click="click()" style="width: 140px;
line-height: 38px;
text-align: center;
font-weight: bold;
color: #555;
text-shadow:1px 1px 1px #333;
border-radius: 5px;
margin:0 20px 20px 0;
position: relative;
overflow: hidden;">
					</form>
				</div>
			</div>
			<div class="contact-grids">
				<h3>联系我们</h3>
				<div class="address-grids">
					<div class="contact">
					<div class="col-md-4 address-text" v-for="obj in contact">
						<div class="address-grid">
							<h5>{{obj.username}}
								<span>{{obj.job}}</span>
							</h5>
							<div class="address-info">
								<div class="address-info-left">
									<p>电话:</p>
								</div>
								<div class="address-info-left address-info-right">
									<p>{{obj.phone}}</p>
								</div>
								<div class="clearfix"> </div>
							</div>
							<div class="address-info">
								<div class="address-info-left">
									<p>邮箱:</p>
								</div>
								<div class="address-info-left address-info-right">
									<p>{{obj.email}}</p>
								</div>
								<div class="clearfix"> </div>
							</div>
							<div class="address-info">
								<div class="address-info-left">
									<p>微信:</p>
								</div>
								<div class="address-info-left address-info-right">
									<p>{{obj.phone}}</p>
								</div>
								<div class="clearfix"> </div>
							</div>

						</div>
					</div>

					<div class="clearfix"> </div>
				</div>
				</div>
			</div>
	</div> 			
</div>
<!--/start-footer-->
<div class="footer-section">
	<div class="container">
		<div class="footer-grids">
			<div class="col-md-3 footer-grid bottom-nav">
				<h3>跳转页面</h3>
				<ul>
					<li><a href="index.html">主页</a></li>
					<li><a href="menu.html">菜单</a></li>
					<li><a href="events.html">消息</a></li>
					<li><a href="error/404.html">展示</a></li>
					<li><a href="mail.html">联系我们</a></li>
					<div class="clearfix"> </div>
				</ul>
			</div>
			<div class="col-md-3 footer-grid category">
				<h3>作者信息</h3>
				<ul>
					<li><a href="#">作者:DQH,RXD</a> </li>
					<li><a href="#">完成时间:2022/3/29/12:41:58</a>  </li>
					<li><a href="#">学院:重庆三峡学院</a> </li>
					<li><a href="#">地址:重庆</a> </li>
					<div class="clearfix"> </div>
				</ul>
			</div>
			<div class="col-md-3 footer-grid brands">
				<h3>项目信息 </h3>
				<ul>
					<li><a href="#">名字:一点餐</a>  </li>
					<li><a href="#">用户端</a> </li>
					<li><a href="#">创建时间:2021年9月21日11:56:54</a> </li>
					<li><a href="#">完成时间:2022年4月21日11:55:52</a> </li>

					<div class="clearfix"></div>
				</ul>
			</div>
			<div class="col-md-3 footer-grid contact-list">
				<h3>电话咨询</h3>
				<ul>
					<li>18225497037</li>
					<li>18225497037</li>
					<div class="clearfix"> </div>
				</ul>

			</div>
			<div class="clearfix"> </div>
		</div>
	</div>
</div>
<!--//End-foote-->
<div class="copy-right-section">
	<div class="container">
		<div class="col-md-6 copy-right">
			<p>---------2022年4月21日12:45:27----------------<a target="_blank" href="http://sc.chinaz.com/moban/">联系我们</a></p>
		</div>
		<div class="col-md-6 social-icons">
			<ul class="soc_icons2">
				<li><a href="#"><img src="images/QQ方.png" alt="" width="62px"></a></li>
				<li><a href="#"><img src="images/微信.png" alt="" width="44px"></a></li>
				<li><a href="#"><img src="images/twitter.png" alt="" width="49px"></a></li>
				<div class="clearfix"> </div>
			</ul>

		</div>
	</div>
</div>
</body>
<script>
	let contact = new Vue({
		el: ".contact",
		data: {
			contact: []
		},
		created: function () {

			axios.get("/menu/contact").then(function (response) {
				contact.contact = response.data;
			})
		}
	})

	let vm = new Vue({
		el:".form",
		data:{
			username:"",
			email:"",
		},
		methods:{

			click:function () {

				let form = document.getElementById("myForm");
				// 用表单来初始化
				let formData = new FormData(form);
				formData.append("userName",vm.username);
				formData.append("email",vm.email);

				let sb=$("#myForm").serialize();
				//console.log(formData.get(userName));
				axios.post("/menu/comments",formData).then(function (response) {
					if (response.data===1){
						alert("感谢您的建议，我们会留意")
						location.href = "/mail.html"
					}else {
						alert("...出错了...")
					}

				})
			}
		}
	})

	// 取出cookie里面保存的用户名和密码
	let cookies = document.cookie.split(";")
	for (let cookie of cookies) {
		let arr = cookie.split("=");
		let name = arr[0]
		let value = arr[1]
		if (name.trim()=="username"){
			vm.username = value;
		}
		if (name.trim()=="email"){
			vm.email = value;
		}
	}
	console.log(vm.username)
</script>
</html>